<layout name="master"/>
<ul class="breadcrumb no-border no-radius b-b b-light pull-in">
    <li><a href="index.html"><i class="fa fa-home"></i> Home</a></li>
    <li><a href="#">分类</a></li>
    <li><a href="#">分类管理</a></li>
</ul>
<div class="m-b-md">
    <h3 class="m-b-none">分类管理</h3>
</div>
<div class="row">
    <div class="col-sm-12">
        <section class="panel panel-default">
            <header class="panel-heading font-bold">分类列表</header>
            <div class="panel-body">
                <form role="form" action="" method="post">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th>分类ID</th>
                            <th>分类名称</th>
                            <th>排序</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="cateData" id="v">
                            <tr>
                                <td>{$v['cid']}</td>
                                <td>{$v['_cname']}</td>
                                <td>{$v['sort']}</td>
                                <td>
                                    <div class="btn-group">
                                        <a href="{:U('add', array('pid' => $v['cid']))}" class="btn btn-success"><i class="icon-edit icon-white"></i>添加子分类</a>
                                        <a href="{:U('add', array('cid' => $v['cid']))}" class="btn btn-info"><i class="icon-pencil icon-white"></i>修改</a>
                                        <a href="{:U('delCate', array('cid' => $v['cid']))}" class="btn btn-danger"><i class="icon-trash icon-white"></i>删除</a>
                                    </div>
                                </td>
                            </tr>

                        </volist>

                        </tbody>

                    </table>
                    <input type="submit" value='排序' class="btn btn-primary"/>
                </form>
            </div>
        </section>
    </div>
</div>
<script>
    function delType(tid) {
        require(['util'], function (util) {
            var obj = util.modal({
                title:'确认删除吗?',//标题
                content:'',//内容
                footer:'<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button><button type="button" class="btn btn-danger confirm" data-dismiss="modal">确认</button>',//底部
                width:600,//宽度
                events:{
                    confirm:function(){
                        //哪个元素上有.confirm类，被点击就执行这个回调
                        location.href = '__CONTROLLER__/delCate/' + 'cid/' + tid;
                    }
                }
            });
            //显示模态框
            obj.modal('show');
        });
    }
</script>
